﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SistemaAcademicoBO.Entities;
using SistemaAcademicoBO;
using SistemaAcademicoDAL;

namespace SistemaAcademicoBLL.Managers
{
    class SubjectManager
    {
        private SubjectDAO subjectDAO;

        public SubjectManager()
        {
            subjectDAO = new SubjectDAO();
        }

        public Subject GetSubject(int id)
        {
            return (Subject)subjectDAO.GetRecord(id);
        }

        public List<Subject> GetAllSubjects()
        {
            List<IEntity> entityList = subjectDAO.GetAllRecords();
            List<Subject> subjectList = new List<Subject>();
            foreach (IEntity entity in entityList)
            {
                subjectList.Add((Subject)entity);
            }

            return subjectList;
        }

        public void SetSubject(Subject subject)
        {
            subjectDAO.SetRecord(subject);
        }

        public void RemoveSubject(int id)
        {
            subjectDAO.RemoveRecord(id);
        }
    }
}
